package org.hong.entity;


import lombok.Data;

@Data
public class Response {

    private Integer code;

    private String msg;

    private Object data;


    public Response(){

    }

    public Response(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static Response ok(Object data){

        return new Response(200,
                "请求成功",
                data);
    }
    public static Response fail(Integer code, String msg){

        return new Response(code,
                msg,
                null);
    }


}